What's a Head Without a Body?

نویسندگان

  • Christian Anger
  • Martin Gebser
  • Tomi Janhunen
  • Torsten Schaub
چکیده

Concepts in Answer Set Programming (ASP) are normally defined in terms of atoms. We show that the treatment of atoms and bodies (of rules) as equitable computational objects may yield exponential speed-ups, even for standard ASP-solvers such as smodels. To this end, we give simple transformations providing solvers with access to both kinds of objects and show that some families of examples can be solved exponentially faster after they have been transformed. We prove that these transformations may yield exponentially smaller search spaces. 1 SIMULATING HEADS AND BODIES For a detailed introduction to Answer Set Programming (ASP), we refer the reader to the literature (cf. [3]) and confine ourselves to formalities essential to our contribution: Given an alphabet P , a logic program is a finite set of rules, r, of the form p0 ← p1, . . . , pm,not pm+1, . . . ,not pn where n ≥ m ≥ 0 and pi ∈ P is an atom for 0 ≤ i ≤ n. Let head(r) = p0 be the head of r and body(r) = {p1, . . . , pm,not pm+1, . . . ,not pn} be the body of r. The set of atoms occurring in a logic program Π is given by atom(Π). The set of bodies in Π is body(Π) = {body(r) | r ∈ Π}. An answer set of a logic program Π is a model of Π that satisfies a certain “stability criterion” (cf. [3]). We consider the following systems: (i) smodels [7], as a an atombased ASP-solver, assigning truth values to atoms only; (ii) dlv [5], also atom-based, yet designed for handling disjunctive logic programs; (iii) nomore++ [1], pursuing a hybrid approach, wherein truth values are assigned to both atoms and bodies; (iv) a restriction of nomore++ to assignments to bodies only, indicated by nomore++ . 4 All systems incorporate techniques such as propagation and lookahead in their solving procedures [1, 7]. Inspired by structural normal form translations [2], we give two simple transformations introducing new symbols for bodies and atoms, respectively. This allows standard ASP-solvers to access the underlying structures and implicitly incorporate them in their solving procedures. To this end, we extend the alphabet P of a program Π by adding a new atom αa for each a ∈ atom(Π) and a new atom βB for each B ∈ body(Π). We then define a transformation over the extended alphabet: TB(Π) =  βB ← B head(r) ← βB ̨̨̨̨ r ∈ Π, B = body(r) ff This enables ASP-solvers branching on atoms, like smodels, to indirectly incorporate bodies as computable objects in their solving procedures. Vice versa, a different transformation over the extended 1 Universität Potsdam, Postfach 90 03 27, D–14439 Potsdam, Germany 2 Helsinki University of Technology, P.O. Box 5400, FI-02015 TKK, Finland. 3 Affiliated with Simon Fraser University, Canada. 4 To distinguish full-fledged nomore++ in (iii) from this restricted variant, we sometimes add superscript a+B, yielding nomore++a+B . alphabet enables body-based systems (such as nomore++) to indirectly incorporate atoms: Ta(Π) =  αa ← body(r) a ← αa ̨̨̨̨ r ∈ Π, a = head(r) ff As an example, consider program Π along with its transforms: Π =  a ← b,not c a ← d,not e ff TB(Π) = 8<>: β{b,not c} ← b,not c a ← β{b,not c} β{d,not e} ← d,not e a ← β{d,not e} 9=>; Ta(Π) = <: αa ← b,not c αa ← d,not e a ← αa =; To begin with, we empirically underpin our claim that treating atoms and bodies as equitable computational objects may yield exponential speed-ups by some experimental results. As common in proof complexity [4], we need an infinite family of logic programs witnessing an exponential behavior in the best-case. For this, we consider the following programs ΠB and Π n a for n ≥ 0: ΠB = 8><>>>>: r0 : x← not x r1 : x← not a1,not b1 .. rn : x← not an,not bn rn+1 : a1 ← not b1 rn+2 : b1 ← not a1 .. .. r3n−1 : an ← not bn r3n : bn ← not an 9>=>>>>; Πa = 8><>>>>: r0 : x← c1, . . . , cn,not x r1 : c1 ← not a1 r2 : c1 ← not b1 .. .. r2n−1 : cn ← not an r2n : cn ← not bn r2n+1 : a1 ← not b1 r2n+2 : b1 ← not a1 .. .. r4n−1 : an ← not bn r4n : bn ← not an 9>=>>>>; None of these programs has an answer set, that is, all of them are unsatisfiable. Importantly, this can be determined linearly. In both programs, the source of unsatisfiability lies in r0. For Programs ΠB , this can be found out linearly by assigning “true” to bodies of the form {not ai,not bi} (1 ≤ i ≤ n) and by subsequent propagation. For smodels, transformation TB makes these bodies indirectly accessible. With Programs Πa , assigning “false” to an atom ci (1 ≤ i ≤ n) leads to a conflict by propagation. For nomore++ , transformation Ta makes these atoms indirectly accessible. The programs are composed in such a way that lookahead on the crucial structures (bodies and atoms, respectively) is able to determine the optimal choices and thus ensures that the minimal number of choices is obtained. 5 Unlike this, detecting the unsatisfiability of ΠB with the atom-based smodels strategy requires exponentially many choices. The same holds for Πa with nomore++’s strategy. The dlv system employs a slightly different lookahead strategy with fewer lookahead operations, which is why it is unable to identify the best choices for the given program classes. We give dlv results purely for the record. We have implemented the above transformations and run benchmarks on a number of instances of ΠB and Π n a and their transforms. The implementation is available at [6]. Results of these benchmarks are given in Table 1 and 2. All tests were run on an AMD Athlon 1.4GHz PC with 512MB RAM. We limited memory to 256MB and time to 900s. All results are given in terms of number of choices and seconds (in parentheses), reflecting the average of 10 runs. The application of a translation is indicated by TB or Ta, respectively, otherwise a hyphen indicates no such application. We see that the application of transformation TB leads to an exponential speed-up for smodels on ΠB , while Ta exponentially speeds up nomore++ on Πa . On the other hand, a superfluous transformation (as in the case of Ta(Πa) when running smodels) seems not to hurt the performance significantly. In terms of choices, the hybrid approach of nomore++ lets it perform optimally on both ΠB and Π n a . dlv (2006.01.12) smodels (2.28) nomore++ (1.4) B a+B n – TB – TB – TB – TB 2 (0.00) (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 4 (0.00) (0.01) 3 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 6 (0.00) (0.01) 15 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.02) 8 (0.00) (0.01) 63 (0.01) 0 (0.01) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 10 (0.01) (0.03) 255 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 12 (0.05) (0.07) 1,023 (0.02) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 14 (0.20) (0.24) 4,095 (0.03) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 16 (0.81) (0.93) 16,383 (0.12) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 18 (3.25) (3.76) 65,535 (0.45) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 20 (13.16) (15.05) 262,143 (1.77) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 22 (53.06) (61.17) 1,048,575 (7.09) 0 (0.02) 0 (0.01) 0 (0.03) 0 (0.01) 0 (0.02) 24 (213.93) (247.57) 4,194,303 (28.54) 0 (0.02) 0 (0.01) 0 (0.03) 0 (0.01) 0 (0.02) 26 (862.69) > 900 16,777,215 (114.56) 0 (0.02) 0 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 28 > 900 > 900 67,108,863 (460.30) 0 (0.02) 0 (0.02) 0 (0.03) 0 (0.02) 0 (0.03) 30 > 900 > 900 > 900 0 (0.03) 0 (0.02) 0 (0.03) 0 (0.02) 0 (0.03) Table 1. Results for family {ΠB}. dlv (2006.01.12) smodels (2.28) nomore++ (1.4) B a+B n – Ta – Ta – Ta – Ta 2 (0.00) (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 4 (0.00) (0.01) 0 (0.01) 0 (0.01) 3 (0.01) 0 (0.01) 0 (0.01) 0 (0.01) 6 (0.00) (0.01) 0 (0.01) 0 (0.01) 15 (0.01) 0 (0.02) 0 (0.01) 0 (0.02) 8 (0.01) (0.02) 0 (0.01) 0 (0.02) 63 (0.02) 0 (0.02) 0 (0.01) 0 (0.02) 10 (0.02) (0.05) 0 (0.01) 0 (0.02) 255 (0.03) 0 (0.02) 0 (0.01) 0 (0.02) 12 (0.06) (0.16) 0 (0.01) 0 (0.01) 1,023 (0.07) 0 (0.02) 0 (0.01) 0 (0.02) 14 (0.24) (0.60) 0 (0.01) 0 (0.02) 4,095 (0.25) 0 (0.02) 0 (0.01) 0 (0.02) 16 (0.95) (2.47) 0 (0.01) 0 (0.02) 16,383 (0.98) 0 (0.02) 0 (0.01) 0 (0.02) 18 (3.86) (10.18) 0 (0.01) 0 (0.02) 65,535 (3.88) 0 (0.03) 0 (0.01) 0 (0.02) 20 (15.61) (42.04) 0 (0.01) 0 (0.02) 262,143 (15.51) 0 (0.03) 0 (0.02) 0 (0.02) 22 (63.36) (173.98) 0 (0.01) 0 (0.02) 1,048,575 (61.99) 0 (0.03) 0 (0.02) 0 (0.02) 24 (257.14) (718.17) 0 (0.01) 0 (0.02) 4,194,303 (248.74) 0 (0.03) 0 (0.02) 0 (0.02) 26 > 900 > 900 0 (0.02) 0 (0.02) > 900 0 (0.03) 0 (0.02) 0 (0.03) 28 > 900 > 900 0 (0.01) 0 (0.03) > 900 0 (0.04) 0 (0.02) 0 (0.03) 30 > 900 > 900 0 (0.02) 0 (0.03) > 900 0 (0.04) 0 (0.02) 0 (0.03) Table 2. Results for family {Πa}. Finally, let us show that our observation is not accidental and formally prove that the availability of both atoms and bodies may lead to exponentially smaller search spaces than obtainable in either restricted case. To this end, we apply well-known concepts from proof complexity [4] and show that there are infinite witnessing families of programs for which even the best-case complexity is exponential. To 5 With lookahead disabled, propagation does not suffice to detect unsatisfiability. Thus, linearly many choices must be made. 6 The choices of dlv are omitted since they rely on a different concept. be more precise, we show that minimal refutations for ΠB and Π n a , i.e. proofs that the respective programs have no answer sets, require exponentially many choices in the cases ofΠB with smodels andΠ n a with nomore++ , while a linear number of choices is required for the transformed programs. Theorem 1 There is an infinite family {Π} of logic programs such that the minimal number of choices made by smodels for determining the unsatisfiability of Π is O(2) and of TB(Π) is O(n). Theorem 2 There is an infinite family {Π} of logic programs such that the minimal number of choices made by nomore++ for determining the unsatisfiability of Π is O(2) and of Ta(Π) is O(n). In neither case is it possible to simulate this behavior polynomially, as witnessed by families {ΠB} and {Πa}, respectively. Finally, we note that the hybrid approach pursued by nomore++ gives a best-case complexity of O(n) for both classes of programs: A hybrid approach can polynomially simulate both uniform approaches.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

What's new in orthopaedic trauma

What's new in orthopaedic trauma." The

متن کامل

Establishment of dynamic postural assessment indicators in young girls with and without hyper-kyphosis

Hyper-kyphosis anomalies are common disorders of spine. The aim of this study was to Establishment of dynamic postural assessment indicators in young girls with and without hyper-kyphosis. In the study, 200 girls were selected according to the angle of kyphosis they were divided into two groups comprising of with and without Hyper-kyphosis. Evaluate dynamic posture, the tests back flattening,...

متن کامل

Fuzzy Clustering Based Routing in Wireless Body Area Networks to Increase the Life of Sensor Nodes

Body area networks is one of the types of wireless area networks which has been created to optimize utilizing hospital resources and for earlier diagnosis of medical symptoms, and ultimately to reduce the cost of medical care. This network like most of the wireless networks is without infrastructure and the embedded sensor nodes in the body have limited energy. Hence, the early power completion...

متن کامل

What's in a name: the taxonomic status of human head and body lice.

Human head lice (Anoplura: Pediculidae: Pediculus) are pandemic, parasitizing countless school children worldwide due to the evolution of insecticide resistance, and human body (clothing) lice are responsible for the deaths of millions as a result of vectoring several deadly bacterial pathogens. Despite the obvious impact these lice have had on their human hosts, it is unclear whether head and ...

متن کامل

The Relationship between Forward Head Position and Dorsal Kyphosis with non-specific Chronic Low Back Pain in Military Mans

Background and Aim: Improper body posture and differences in spinal angles can lead to orthopedic injuries. Forward head and kyphosis are some of the complications of improper posture that can lead to back pain. The aim of the present study was to investigate the relationship between forward head position and dorsal kyphosis with non-specific chronic low back pain in military mans. Methods: In ...

متن کامل

Foreign Bodies: Aspirated or Ingested? A Report of Two Unusual Cases

Introduction: The diagnosis of foreign bodies in the upper aerodigestive tract is usually straightforward but sometimes it can be delayed or the location of esophageal and upper airway foreign bodies can be mistakenly interchanged.  Case Report: We present two interesting cases that caused diagnostic challenges which could have led to serious complications if a greater delay in diagnosis ha...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006